package top.bulk.idgeneration.entity;

import lombok.Data;

import java.util.concurrent.atomic.AtomicLong;

/**
 * 号段对象
 *
 * @author 散装java
 * @date 2024-08-07
 */
@Data
public class SegmentId {
    private long maxId;
    private long loadingId;
    private AtomicLong currentId;

    public boolean useful() {
        return currentId.get() <= maxId;
    }
}
